﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Polymorphysm_test
{
    class Program
    {
        static void Main(string[] args)
        {
            Parent p = new Parent();
            Parent ch = new Child();
           // p.Print();
            ch.Print();

        }
    }

    class Parent
    {
        public  virtual void Print()
        {
            Console.WriteLine("1");

        }

     }
    //class Child : Parent
    //{

    //    public void Print()
    //    {
    //        Console.WriteLine("4");
    //    }
    //}


    //class Child : Parent
    //{

    //    public  void Print()
    //    {
    //        Console.WriteLine("2");
    //    }

    //}
    class Child : Parent
    {

        public override void Print()
        {
            Console.WriteLine("2");
        }

    }




}
